package com.platform.server.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.platform.server.dao.ComplaintDao;
import com.platform.server.service.ComplaintService;
import com.platform.server.util.StringTools;

@Service
public class ComplaintServiceImpl implements ComplaintService {

	@Autowired
	private ComplaintDao complaintDao;
	
	/**
	 * 投诉列表
	 */
	@Override
	public List<Map<String, Object>> selectComplaintList(String startTime,String endTime,String is_acceptance,String username,String mobile,String order_id) {
		Map<String,Object> map =new HashMap<String, Object>();
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("is_acceptance", is_acceptance);
		map.put("username", username);
		map.put("mobile", mobile);
		map.put("order_id", order_id);
		return complaintDao.selectComplaintList(map);
	}
	/**
	 * 投诉图片
	 */
	@Override
	public List<Map<String, Object>> selectComplaintPic(String id) {
		return complaintDao.selectComplaintPic(id);
	}
	/**
	 * 投诉详情
	 */
	@Override
	public Map<String, Object> selectComplaintInfo(String id) {
		return complaintDao.selectComplaintInfo(id);
	}
	@Override
	public int updateComplaint(Map<String,Object> map) {
		return complaintDao.updateComplaint(map);
	}
	@Override
	public String selectIsComplaint(String id) {
		return complaintDao.selectIsComplaint(id);
	}
	/**
	 * 查看订单详情
	 */
	@Override
	public Map<String, Object> selectOrderInfo(String id) {
		return complaintDao.selectOrderInfo(id);
	}
	@Override
	public int confirmOrder(Map<String, Object> map) {
		return complaintDao.confirmOrder(map);
	}
	@Override
	public Double selectPlatformDiscount() {
		return complaintDao.selectPlatformDiscount();
	}
	@Override
	public Map<String, Object> selectUserMoney(String userid) {
		return complaintDao.selectUserMoney(userid);
	}
	@Override
	public int insertCancelOrder(String userid, String money, String type,
			String orderid, String userMoney, String status,
			String platform_money, String procedure) {
		return complaintDao.insertCancelOrder(userid, money, type, orderid, userMoney, status, platform_money, procedure);
	}
	@Override
	public int updateServerUserMoney(Map<String, Object> map) {
		return complaintDao.updateServerUserMoney(map);
	}
	@Override
	public int returnUserMoney(String userid, String money) {
		return complaintDao.returnUserMoney(userid, money);
	}
	@Override
	public String selectisVip(String user_id) {
		return complaintDao.selectisVip(user_id);
	}
	@Override
	public Double selectVipDiscont() {
		return complaintDao.selectVipDiscont();
	}
	@Override
	public int selectUserAuthentication(String id) {
		return complaintDao.selectUserAuthentication(id);
	}
	@Override
	public Double selectEntUserDiscont() {
		return complaintDao.selectEntUserDiscont();
	}
	@Override
	public String selectParent(String user_id) {
		return complaintDao.selectParent(user_id);
	}
	@Override
	public  Map<String, Object> selectRate() {
		return complaintDao.selectRate();
	}
	@Override
	public Map<String, Object> selectComplaintInfos(String id) {
		return complaintDao.selectComplaintInfos(id);
	}
	@Override
	public String selectis_vip(String user_id, String is_auth) {
		// TODO Auto-generated method stub
		return complaintDao.selectis_vip(user_id, is_auth);
	}
	@Override
	public int insertRoyaltyOrder(String userid, String money, String type,
			String orderid, String userMoney, String status,
			String platform_money, String procedure, String lower_userid) {
		return complaintDao.insertRoyaltyOrder(userid, money, type, orderid, userMoney, status, platform_money, procedure, lower_userid);
	}
	@Override
	public String selectUserMoney2(String userid) {
		// TODO Auto-generated method stub
		return complaintDao.selectUserMoney2(userid);
	}
	@Override
	public List<Map<String, Object>> selectComplaint(String order_id) {
		// TODO Auto-generated method stub
		return complaintDao.selectComplaint(order_id);
	}
	@Override
	public int updateDiscountStatus(Integer couponid) {
		// TODO Auto-generated method stub
		return complaintDao.updateDiscountStatus(couponid);
	}
	@Override
	public String selectUserIntegral(String userid) {
		// TODO Auto-generated method stub
		return complaintDao.selectUserIntegral(userid);
	}
	@Override
	public int returnUserIntegral(String userid, String integral) {
		// TODO Auto-generated method stub
		return complaintDao.returnUserIntegral(userid, integral);
	}
	@Override
	public int insertIntegralRecord(String userid, String integral,
			String type, String recommend_id) {
		// TODO Auto-generated method stub
		return complaintDao.insertIntegralRecord(userid, integral, type, recommend_id);
	}
	@Override
	public Map<String, Object> selectIntegeralWay() {
		// TODO Auto-generated method stub
		return complaintDao.selectIntegeralWay();
	}
	@Override
	public Map<String, Object> selectMyIntegral(String userid) {
		// TODO Auto-generated method stub
		return complaintDao.selectMyIntegral(userid);
	}
	@Override
	public int updateIntegral(String userid, String integral) {
		// TODO Auto-generated method stub
		return complaintDao.updateIntegral(userid, integral);
	}

}
